<template>
  <div>
    <div class="banner" @click="handleGallaryClick">
      <img class="banner-img" :src="bannerimg" alt="">
      <div class="banner-info">
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe600;</span>42
        </div>
        <div class="banner-title">{{this.sightName}}</div>
      </div>
    </div>
    <FadeAnimation>
      <common-gallary :imgs="gallaryImgs" v-show="showGallary" @close="handleGallaryClose"></common-gallary>
    </FadeAnimation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default{
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerimg: String,
    gallaryImgs: Array
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  data () {
    return {
      showGallary: false
    }
  },
  methods: {
    handleGallaryClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
.banner
  position: relative
  overflow: hidden
  height: 0
  padding-bottom: 55%
  .banner-img
    width: 100%
  .banner-info
    position: absolute
    left: 0
    right: 0
    bottom: 0
    line-height: .8rem
    color: #fff
    background-image: linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.8))
    .banner-title
      font-size: .42rem
      padding: 0 .2rem
    .banner-number
      width: .61rem
      padding: 0 .28rem
      margin-top: .16rem
      margin-left: .20rem
      height: .40rem
      line-height: .40rem
      border-radius: .2rem
      background: rgba(0,0,0,.5)
      font-size: .25rem
      .banner-icon
        font-size: .25rem
        margin-right: .1rem
</style>
